package com.kcth.sylyg08.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @program: G08ProductionLine
 * @description 永久存储标签实体类
 * @author: X.Gao
 * @create: 2019-08-09 10:40
 **/

@Entity
@Table(name = "t_syly_commandPer",
        indexes = {
                @Index(name = "FOR_ORDER_BY_DATETIME",
                        columnList = "dateTime,staCode,epcCode,flag,reportStatus,checkNum"),
                @Index(name = "DATETIME",
                        columnList = "dateTime"),
                @Index(name = "EPC_CODE",
                        columnList = "epcCode"),
                @Index(name = "STA_CODE",
                        columnList = "staCode,dateTime"),
        }
)
public class CommandPer implements Serializable {

    //记录对应ID
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    //RFID标签读取内容
    private String epcCode;
    //工位编码
    private String staCode;
    //工位进出标识，进工位用1，出工位用2，出工位并且进下一工位用3
    private String flag;
    //采集时间
    private Date datetime;
    //进入工位次数标志
    @Column(name = "checkNum", columnDefinition = "int default 0")
    private int checkNum;
    //上报状态标志位
    private ReportStatus reportStatus;
    @Transient
    private Date systemTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEpcCode() {
        return epcCode;
    }

    public void setEpcCode(String epcCode) {
        this.epcCode = epcCode;
    }

    public String getStaCode() {
        return staCode;
    }

    public void setStaCode(String staCode) {
        this.staCode = staCode;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }

    public int getCheckNum() {
        return checkNum;
    }

    public void setCheckNum(int checkNum) {
        this.checkNum = checkNum;
    }

    public ReportStatus getReportStatus() {
        return reportStatus;
    }

    public void setReportStatus(ReportStatus reportStatus) {
        this.reportStatus = reportStatus;
    }

    public Date getSystemTime() {
        return systemTime;
    }

    public void setSystemTime(Date systemTime) {
        this.systemTime = systemTime;
    }

    @Override
    public String toString() {
        return "CommandPer{" +
                "epcCode='" + epcCode + '\'' +
                ", staCode='" + staCode + '\'' +
                ", flag='" + flag + '\'' +
                ", datetime=" + datetime +
                ", reportStatus=" + reportStatus +
                ", systemTime=" + systemTime +
                '}';
    }
}
